% parameters
% For Variable Timestepping, the grid will be doubled for each run
% # of steps depends on selector, 
% Initial dTao will be 4 times less than previous one
% dnorm will be halved for each run

rows = 5; % # times the program will be runned
T = 0.25; step0 = 25;
r = 0.03; sigma = 0.4; S0 = 100; K = 100; D = 1; option = 0;
nodeM = 1:rows;
% Time Step
steps = step0*4.^(0:rows-1);
dnorm = 0.1./2.^(0:rows-1);
V = zeros(rows,1);
nNode = zeros(rows,1);
nsteps = zeros(rows,1);
tic
for i=1:rows
    [V(i), nsteps(i), optionV] = euVarTime(r, sigma,S0,K,T,steps(i),option, nodeM(i), D, dnorm(i));
    nNode(i) = length(optionV);
end
toc
change = [0;diff(V)];
ratio = [0;0;change(2:end-1)./change(3:end)];
Output = [nNode,nsteps,dnorm',V,change,ratio];



